package cn.tedu.store.commons.pojo.product.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 添加SPU的DTO类
 *
 * @author RelentlessFlow
 * @version 0.0.1
 */
@Data
public class SpuAddNewDTO implements Serializable {

    /**
     * SPU名称
     */
    @ApiModelProperty(value = "SPU名称", required = true)
    private String name;

    /**
     * SPU编号
     */
    @ApiModelProperty(value = "SPU编号", required = true, example = "SPU010201")
    private String typeNumber;

    /**
     * 标题
     */
    @ApiModelProperty(value = "标题", required = true)
    private String title;

    /**
     * 简介
     */
    @ApiModelProperty(value = "简介", required = true)
    private String description;

    /**
     * 价格（显示在列表中）
     */
    @ApiModelProperty(value = "价格（显示在列表中）", required = true)
    private BigDecimal listPrice;

    /**
     * 当前库存（冗余）
     */
    @ApiModelProperty(value = "当前库存", required = true)
    private Integer stock;

    /**
     * 库存预警阈值（冗余）
     */
    @ApiModelProperty(value = "库存预警阈值", required = true)
    private Integer stockThreshold;

    /**
     * 计件单位
     */
    @ApiModelProperty(value = "计件单位", required = true)
    private String unit;

    /**
     * 品牌id
     */
    @ApiModelProperty(value = "品牌id", required = true)
    private Long brandId;

    /**
     * 类别id
     */
    @ApiModelProperty(value = "类别id", dataType = "long", required = true)
    @NotNull(message = "请选择类别！")
    private Long categoryId;

    /**
     * 属性模板id
     */
    @ApiModelProperty(value = "属性模板id", required = true)
    private Long attributeTemplateId;

    /**
     * 相册id
     */
    @ApiModelProperty(value = "相册id", required = true)
    private Long albumId;

    /**
     * 组图URLs，使⽤JSON格式表示
     */
    @ApiModelProperty(value = "组图URLs,JSON格式表示", required = true)
    private String pictures;

    /**
     * 关键词列表，各关键词使⽤英⽂的逗号分隔
     */
    @ApiModelProperty(value = "关键词列表", required = true)
    private String keywords;

    /**
     *赠送的成长值
     */
    @ApiModelProperty(value = "赠送的成长值", required = true)
    private Integer giftGrowth;

    /**
     * 赠送的积分值
     */
    @ApiModelProperty(value = "赠送的积分值", required = true)
    private Integer giftPoint;

    /**
     * 可用使用积分抵扣的值
     */
    @ApiModelProperty(value = "可用使用积分抵扣的值", required = true)
    private Integer limitPoint;

    /**
     * 是否上架（发布），1=已上架，0=未上架 （下架）
     */
    @ApiModelProperty(value = "是否上架（发布），1=已上架，0=未上架 （下架）", required = true)
    private Integer isPublished;

    /**
     * 是否新品，1=新品，0=非新品
     */
    @ApiModelProperty(value = "是否新品，1=新品，0=非新品", required = true)
    private Integer isNewArrival;

    /**
     * 是否推荐，1=推荐，0=不推荐
     */
    @ApiModelProperty(value = "是否推荐，1=推荐，0=不推荐", required = true)
    private Integer isRecommend;

    /**
     * 促销开始时间
     */
    @ApiModelProperty(value = "促销开始时间")
    private LocalDateTime promotionStartTime;

    /**
     * 促销结束时间
     */
    @ApiModelProperty(value = "促销结束时间")
    private LocalDateTime promotionEndTime;

    /**
     * 活动限购数量
     */
    @ApiModelProperty(value = "活动限购数量")
    private LocalDateTime promotionPerLimit;

    /**
     * 促销类型 0->没有促销使用原价;1->使用促销价；2->使用会员价；3->使用阶梯价格；4->使用满减价格；5->限时购'
     */
    @ApiModelProperty(value = "标题", required = true)
    private LocalDateTime promotionType;

    /**
     * 标签列表，各标签使⽤英⽂的逗号分隔，原则上最多3个
     */
    @ApiModelProperty(value = "标签列表", required = true)
    private String tags;

    /**
     * ⾃定义排序序号
     */
    @ApiModelProperty(value = "排序序号")
    @Range(min = 1,max = 255,message = "必须在[1,255]区间内")
    private Integer sort;

    /**
     * Spu详情
     */
    @ApiModelProperty(value = "Spu详情", required = true)
    private String detail;

}
